package com.onion.utils.file;

import java.io.BufferedWriter;
import java.io.FileWriter;
import java.io.IOException;

public class TxtWriter {

    public static void append(String outFile, String data) {
        BufferedWriter bWriter = null;
        try{
            bWriter = new BufferedWriter(new FileWriter(outFile, true));
            bWriter.write(data);
        } catch (IOException e1){
        } finally {
            if(bWriter != null){
                try{
                    bWriter.flush();
                    bWriter.close();
                }catch (IOException e2){
                }
            }
        }
    }

    public static void write(String outFile, String data) {
        BufferedWriter bWriter = null;
        try{
            bWriter = new BufferedWriter(new FileWriter(outFile));
            bWriter.write(data);
        } catch (IOException e1){
        } finally {
            if(bWriter != null){
                try{
                    bWriter.flush();
                    bWriter.close();
                }catch (IOException e2){
                }
            }
        }
    }

}